package 集合;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

/**
 * @描述: ArrayList输出的几种方法
 * @作者: 宋利军 
 */

public class Collection_ArrayList {
	public static void main(String args[]) {
		Collection collection = new ArrayList();
		collection.add(2);
		collection.add(3);
		collection.add(4);
		collection.add(5);
		collection.add(6);
		System.out.println(collection);
		System.out.println(collection.isEmpty());
		System.out.println(collection.size());
		System.out.println(collection.toString());
		System.out.println(collection.toArray());
		System.out.println(collection.toArray());
		System.out.println(collection.retainAll(collection));
		System.out.println("-----------分割线----------");
		System.out.println(collection.equals("3"));
	}
}